package com.cx.mapper;

import com.cx.pojo.Carts;
import com.cx.pojo.CartsExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface CartsMapper {
    int countByExample(CartsExample example);

    int deleteByExample(CartsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Carts record);

    int insertSelective(Carts record);

    List<Carts> selectByExample(CartsExample example);

    Carts selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Carts record, @Param("example") CartsExample example);

    int updateByExample(@Param("record") Carts record, @Param("example") CartsExample example);

    int updateByPrimaryKeySelective(Carts record);

    int updateByPrimaryKey(Carts record);

    int deleteByUserId(Integer userId);

    List<Carts> selectByUserId(Integer id);

    int updateByGoodId(Carts carts);

    int deleteByUserIdAndGoodId(@Param("userId")Integer userId , @Param("goodId")Integer goodId);

    Carts selectByUserIdAndGoodId(@Param("userId") int userId,@Param("goodId") int goodId);
}